package LBT3;
import LBT2.LinkedBinaryTree;
import java.util.Scanner;

public class jueceTree {


    private LinkedBinaryTree<String> tree;

    public jueceTree(){

        String e1 = "你玩游戏吗？";

        String e2 = "你玩LOL吗？";

        String e3 = "你玩CSGO吗？";

        String e4 = "这游戏真的很棒！";

        String e5 = "你知道它属于MOBA游戏吗？";

        String e6 = "这游戏可是FPS游戏很经典的";

        String e7 = "那你知道S1MPLE这名选手吗？";


        String e8 = "那你喜欢玩MOBA游戏吗。";

        String e9 = "其他MOBA游戏像DOTA也很好玩。";

        String e10 = "最近很火的手游王者荣耀也是属于MOBA";

        String e11 = "那你知道还有哪些MOBA游戏吗";


        String e12 = "如果你喜欢这个游戏的话，我推荐去了解一下";

        String e13 = "如果你喜欢这个游戏的话，我推荐去了解一下";

        String e14 = "如果你喜欢这个游戏的话，我推荐去了解一下";

        String e15 = "今年TOP20都很厉害呢";

        LinkedBinaryTree<String>n2,n3,n4,n5,n6,n7,n8,n9,n10,n11,n12,n13,n14,n15;

        n15 = new LinkedBinaryTree<String>(e15);

        n14 = new LinkedBinaryTree<String>(e14);

        n11 = new LinkedBinaryTree<String>(e11,n14,n15);

        n12 = new LinkedBinaryTree<String>(e12);

        n13 = new LinkedBinaryTree<String>(e13);


        n7 = new LinkedBinaryTree<String>(e7,n12,n13);

        n8 = new LinkedBinaryTree<String>(e8);

        n9 = new LinkedBinaryTree<String>(e9);

        n5 = new LinkedBinaryTree<String>(e5,n8,n9);


        n10 = new LinkedBinaryTree<String>(e10);

        n6 = new LinkedBinaryTree<String>(e6,n10,n11);

        n4 = new LinkedBinaryTree<String>(e4);

        n2 = new LinkedBinaryTree<String>(e2,n4,n5);

        n3 = new LinkedBinaryTree<String>(e3,n6,n7);

        tree = new LinkedBinaryTree<String>(e1,n2,n3);

    }


    public void diagose() throws Exception {


        Scanner scan = new Scanner(System.in);


        LinkedBinaryTree<String>current = tree;
        while (current.size() > 1)
        {
            System.out.println (current.getRootElement());
            if (scan.nextLine().equalsIgnoreCase("N"))
                current = current.getLeft();
            else
                current = current.getRight();


        }

        System.out.println (current.getRootElement());


    }



}
